<template>
	<view class="user-info-viewport">
		<view class="banner-wrapper">
			<view class="place-holder-top">
			</view>
			<view class="place-holder-bottom"></view>
		</view>
		<view class="list-container">
			<view class="item-card">
				<view class="title">
					<view class="title-flag"></view>
					<view class="title-txt">
						个人信息
					</view>
				</view>
				<view class="detail-list">
					<view class="detail-wrapper first-line">
						<view class="detail-label">
							个人信息
						</view>
						<view class="detail-value">
							{{userName}}
						</view>
					</view>
					<view class="detail-wrapper">
						<view class="detail-label">
							合作方编号
						</view>
						<view class="detail-value">
							{{unionId}}
						</view>
					</view>
					<view class="detail-wrapper">
						<view class="detail-label">
							手机号码
						</view>
						<view class="detail-value">
							-
						</view>
					</view>
				</view>
			</view>
			<view class="item-card" v-if="false">
				<view class="title">
					<view class="title-flag"></view>
					<view class="title-txt">
						个人信息
					</view>
				</view>
				<view class="detail-list">
					<view class="detail-wrapper first-line">
						<view class="detail-label">
							手机号码
						</view>
						<view class="detail-value">
							181****5387
						</view>
					</view>
					<view class="detail-wrapper">
						<view class="detail-label">
							合作方编号
						</view>
						<view class="detail-value">
							20066775
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				userInfo: this.$store.state.USER,
			};
		},
		computed: {
			userName() {
				const { username } = this.userInfo
				return username.substr(0, 1) + new Array(username.length - 1).fill('*').join('')
			},
			unionId() {
				return this.$store.state.customerId
			}
		}
	}
</script>

<style lang="scss">
page {
	background-color: #fff;
}
.user-info-viewport {
	.banner-wrapper {
		.place-holder-top {
			background-color: #e41f19;
			height: 40rpx;
			.filter-wrapper {
				display: flex;
				align-items: center;
				font-size: 22rpx;
				justify-content: center;
				color: #FFF;
			}
		}
		.place-holder-bottom {
			position: relative;
			border-radius: 14rpx;
			background-color: #fff;
			margin-top: -30rpx;
			height: 40rpx;
		}
	}
	.list-container {
		padding: 0 30rpx 0;
		.item-card {
			.title {
				display: flex;
				padding: 20rpx 0;
				border-bottom: 1px solid #eee;
				.title-flag {
					width: 10rpx;
					border-top-right-radius: 6rpx;
					border-bottom-left-radius: 6rpx;
					background-color: #ec3e30;
				}
				.title-txt {
					padding-left: 14rpx;
					color: #333;
					font-size: 32rpx;
				}
			}
			.detail-list {
				.detail-wrapper {
					display: flex;
					justify-content: space-between;
					padding: 20rpx 0;
					color: #b1b1b1;
					font-size: 28rpx;
					&.first-line {
						padding-top: 30rpx;
					}
				}
			}
		}
	}
}
</style>
